export {}
// 1 .!非空断言
const v11: string | undefined | null = 'hello'
// "!."表示v11绝不可能为空
const v11Len = v11!.length
console.log(v11Len)

console.log()
console.log('=======================================================')

// 2 .?可选链运算符(Optional Chaining)
interface V12 {
  name: string
  profile?: {
    city?: string
  }
}

let v12: V12 = {
  name: 'hello',
}

let v121City = v12.profile?.city
console.log(v121City)

console.log()
console.log('=======================================================')
// 3 .?空值合并(Null Merge)

// null merger ??
let v31NullMerge: string | null = null
console.log(v31NullMerge ?? 'hello') // hello
v31NullMerge = 'test'
console.log(v31NullMerge ?? 'hello') // hello
